package fr.uniscol.view;

import java.util.Locale;

import org.springframework.web.servlet.View;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.view.json.MappingJacksonJsonView;

public class JSonViewResolver implements ViewResolver {

	@Override
	public View resolveViewName(String viewName, Locale locale)
	throws Exception {
		
		if(!viewName.endsWith("json")){
			return null;
		}
		
		 MappingJacksonJsonView view = new MappingJacksonJsonView();
	     return view;
	}

}
